{% load html %}
{% load i18n %}

<div class="message-actions">
  <div class="message-actions-box">
    <h3 class="sr-only">{% trans 'Print or share your certificate' as tmsg %}{{ tmsg | htmlescape }}</h3>
    {% if enable_facebook_sharing %}
      <button title="{% trans 'Share this certificate via Facebook' as tmsg %} {{tmsg | htmlescape}}" class="action btn icon-only action-facebook"
              disabled data-track-type="click"
              data-track-event="edx.bi.credentials.facebook_share.attempted"
              data-track-event-property-category="certificate"
              data-track-event-property-credential-uuid="{{ user_credential.uuid }}"
              data-track-event-property-program-uuid="{{ user_credential.credential.program_uuid }}">
        <span class="fa fa-facebook" aria-hidden="true"></span>
        <span class="action-label">{% trans 'Share this certificate via Facebook' as tmsg %}{{ tmsg | htmlescape }}</span>
      </button>
    {% endif %}

    {% if enable_twitter_sharing %}
      <button title="{% trans 'Tweet this certificate' as tmsg %} {{tmsg | htmlescape}}" class="action btn icon-only" data-track-type="click"
              data-track-event="edx.bi.credentials.twitter_share.attempted"
              data-track-event-property-category="certificate"
              data-track-event-property-credential-uuid="{{ user_credential.uuid }}"
              data-track-event-property-program-uuid="{{ user_credential.credential.program_uuid }}">
        <a class="share-link" target="_blank"
           href="https://twitter.com/intent/tweet?text={{ tweet_text|urlencode }}&url={{ share_url|urlencode }}{% if twitter_username %}&via={{ twitter_username }}{% endif %}">
          <span class="fa fa-twitter" aria-hidden="true"></span>
          <span class="action-label">{% trans 'Tweet this certificate' as tmsg %}{{ tmsg | htmlescape }}</span>
        </a>
      </button>
    {% endif %}

    {% if enable_linkedin_sharing %}
      <button title="{% trans 'Add to LinkedIn profile' as tmsg %}{{ tmsg|htmlescape }}" class="action btn icon-only" data-track-type="click"
              data-track-event="edx.bi.credentials.linkedin_share.attempted"
              data-track-event-property-category="certificate"
              data-track-event-property-credential-uuid="{{ user_credential.uuid }}"
              data-track-event-property-program-uuid="{{ user_credential.credential.program_uuid }}">
        <a class="share-link" target="_blank"
           href="https://www.linkedin.com/profile/add?startTask=CERTIFICATION_NAME">
          <span class="fa fa-linkedin" aria-hidden="true"></span>
          <span class="action-label">{% trans 'Add this certificate to your LinkedIn profile' as tmsg %}{{ tmsg | htmlescape }}</span>
        </a>
      </button>
    {% endif %}

    <button title="{% trans 'Print' as tmsg %}{{tmsg|htmlescape}}" class="action btn icon-only" onclick="window.print();" data-track-type="click"
            data-track-event="edx.bi.credentials.print.attempted"
            data-track-event-property-category="certificate"
            data-track-event-property-credential-uuid="{{ user_credential.uuid }}"
            data-track-event-property-program-uuid="{{ user_credential.credential.program_uuid }}">
      <span class="fa fa-print" aria-hidden="true"></span>
      <span class="action-label">{% trans 'Print this certificate' as tmsg %}{{ tmsg | htmlescape }}
      </span>
    </button>
  </div>
</div>
